package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

/**
 * 用户实体类
 */
@Data
@NoArgsConstructor
@ToString
@TableName("t_user")
public class UserBean {
    @TableId(value = "pk_userId",type = IdType.AUTO)
    /**用户id*/
    private Integer id;

    @TableField("u_name")
    /**用户名字*/
    private String name;

    @TableField("u_pwd")
    /**用户密码*/
    private String pwd = "123";

    @TableField("u_realName")
    /**真实姓名*/
    private String realName;
    /**
     * 员工状态（在职/离职）
     */
    @TableField("u_status")
    private String status="在职";
    @TableField(exist = false)
    /**角色的集合*/
    private List<RoleBean> roleList;
    @TableField(exist = false)
    private List<Integer> perIdList;

    @TableField(exist = false)
    /**权限集合*/
    private List<PermissionBean> permissionList;
    @TableField("u_salt")
    /**盐*/
    private String salt;

    public UserBean(String name, String pwd, String realName) {
        this.name = name;
        this.pwd = pwd;
        this.realName = realName;
    }
}
